<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Class template node_allocator</title>
<link rel="stylesheet" href="../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
<link rel="up" href="../../boost_container_header_reference.html#doxygen.boost_container_header_reference.node__allocator_8hpp" title="Header &lt;boost/container/node_allocator.hpp&gt;">
<link rel="prev" href="structboost_1_1container_1_1new__allocator_3_01void_01_4_1_1rebind.html" title="Struct rebind">
<link rel="next" href="structboost_1_1container_1_1node__allocator_1_1rebind.html" title="Struct template rebind">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../boost.png"></td>
<td align="center"><a href="../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="structboost_1_1container_1_1new__allocator_3_01void_01_4_1_1rebind.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_container_header_reference.html#doxygen.boost_container_header_reference.node__allocator_8hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="structboost_1_1container_1_1node__allocator_1_1rebind.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1node__allocator"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Class template node_allocator</span></h2>
<p>boost::container::node_allocator</p>
</div>
<h2 class="refsynopsisdiv-title">Synopsis</h2>
<div class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../boost_container_header_reference.html#doxygen.boost_container_header_reference.node__allocator_8hpp" title="Header &lt;boost/container/node_allocator.hpp&gt;">boost/container/node_allocator.hpp</a>&gt;

</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> NodesPerBlock <span class="special">=</span> <span class="identifier">NodeAlloc_nodes_per_block</span><span class="special">&gt;</span> 
<span class="keyword">class</span> <a class="link" href="classboost_1_1container_1_1node__allocator.html" title="Class template node_allocator">node_allocator</a> <span class="special">{</span>
<span class="keyword">public</span><span class="special">:</span>
  <span class="comment">// types</span>
  <span class="keyword">typedef</span> <span class="identifier">T</span>                                                                    <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1node__allocator_1ac739a646a497b3fd7cd66ee467bdc758"></a><span class="identifier">value_type</span><span class="special">;</span>     
  <span class="keyword">typedef</span> <span class="identifier">T</span> <span class="special">*</span>                                                                  <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1node__allocator_1a69950d6b06473185298d6d20ee8a4e99"></a><span class="identifier">pointer</span><span class="special">;</span>        
  <span class="keyword">typedef</span> <span class="keyword">const</span> <span class="identifier">T</span> <span class="special">*</span>                                                            <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1node__allocator_1a8fff88fe5b6c6f3af6246fe356faf01b"></a><span class="identifier">const_pointer</span><span class="special">;</span>  
  <span class="keyword">typedef</span> <span class="special">::</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">container</span><span class="special">::</span><span class="identifier">dtl</span><span class="special">::</span><span class="identifier">unvoid_ref</span><span class="special">&lt;</span> <span class="identifier">T</span> <span class="special">&gt;</span><span class="special">::</span><span class="identifier">type</span>                       <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1node__allocator_1ad5607241fab9d9766fbcc7663fdbd75e"></a><span class="identifier">reference</span><span class="special">;</span>      
  <span class="keyword">typedef</span> <span class="special">::</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">container</span><span class="special">::</span><span class="identifier">dtl</span><span class="special">::</span><span class="identifier">unvoid_ref</span><span class="special">&lt;</span> <span class="identifier">constT</span> <span class="special">&gt;</span><span class="special">::</span><span class="identifier">type</span>                  <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1node__allocator_1ae173e9290684d4008a0b3b1290ef2fc6"></a><span class="identifier">const_reference</span><span class="special">;</span>
  <span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span>                                                          <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1node__allocator_1a7f9a1120006eae206d9d4d01dd8d55c4"></a><span class="identifier">size_type</span><span class="special">;</span>      
  <span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ptrdiff_t</span>                                                       <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1node__allocator_1a8098300292c4333e09b4ef47c4f8d4ed"></a><span class="identifier">difference_type</span><span class="special">;</span>
  <span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">container</span><span class="special">::</span><span class="identifier">dtl</span><span class="special">::</span><span class="identifier">version_type</span><span class="special">&lt;</span> <span class="identifier">self_t</span><span class="special">,</span><span class="special">(</span><span class="keyword">unsigned</span> <span class="keyword">int</span><span class="special">)</span> <span class="identifier">Version</span> <span class="special">&gt;</span> <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1node__allocator_1a02489937671f25d8db9e0916d49df1bf"></a><span class="identifier">version</span><span class="special">;</span>        

  <span class="comment">// member classes/structs/unions</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T2<span class="special">&gt;</span> 
  <span class="keyword">struct</span> <a class="link" href="structboost_1_1container_1_1node__allocator_1_1rebind.html" title="Struct template rebind">rebind</a> <span class="special">{</span>
    <span class="comment">// types</span>
    <span class="keyword">typedef</span> <a class="link" href="classboost_1_1container_1_1node__allocator.html" title="Class template node_allocator">node_allocator</a><span class="special">&lt;</span> <span class="identifier">T2</span><span class="special">,</span> <span class="identifier">NodesPerBlock</span> <span class="special">&gt;</span> <a class="link" href="structboost_1_1container_1_1node__allocator_1_1rebind.html#doxygen.boost_container_header_reference.structboost_1_1container_1_1node__allocator_1_1rebind_1aedb1711669085fc246ecb8eba8e22e16"><span class="identifier">other</span></a><span class="special">;</span>
  <span class="special">}</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="classboost_1_1container_1_1node__allocator.html#id67-bb">public member functions</a></span>
  <a class="link" href="classboost_1_1container_1_1node__allocator.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1node__allocator_1a8a9ba47bdd739c3e42843b791aad7bf7"><span class="identifier">node_allocator</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
  <a class="link" href="classboost_1_1container_1_1node__allocator.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1node__allocator_1acea99bdd0b53a8f44deefa5b6991a8a2"><span class="identifier">node_allocator</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1container_1_1node__allocator.html" title="Class template node_allocator">node_allocator</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T2<span class="special">&gt;</span> 
    <a class="link" href="classboost_1_1container_1_1node__allocator.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1node__allocator_1a8fe90ccfc204384f56455cdf40d2cd1e"><span class="identifier">node_allocator</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1container_1_1node__allocator.html" title="Class template node_allocator">node_allocator</a><span class="special">&lt;</span> <span class="identifier">T2</span><span class="special">,</span> <span class="identifier">NodesPerBlock</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
  <a class="link" href="classboost_1_1container_1_1node__allocator.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1node__allocator_1aae3f498dc2f6efe96c45ba9d4ef26f6a"><span class="special">~</span><span class="identifier">node_allocator</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
  <span class="identifier">size_type</span> <a class="link" href="classboost_1_1container_1_1node__allocator.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1node__allocator_1ae9b979a89b441c9595841ce7bd9c7948"><span class="identifier">max_size</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">pointer</span> <a class="link" href="classboost_1_1container_1_1node__allocator.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1node__allocator_1a8bdfe2748b031138cedddf629b07366f"><span class="identifier">allocate</span></a><span class="special">(</span><span class="identifier">size_type</span><span class="special">,</span> <span class="keyword">const</span> <span class="keyword">void</span> <span class="special">*</span> <span class="special">=</span> <span class="number">0</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="classboost_1_1container_1_1node__allocator.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1node__allocator_1a43fd4c135ae0ddfd386925f27d6ac82c"><span class="identifier">deallocate</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">pointer</span> <span class="special">&amp;</span><span class="special">,</span> <span class="identifier">size_type</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
  <span class="identifier">pointer</span> <a class="link" href="classboost_1_1container_1_1node__allocator.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1node__allocator_1a1d5cfc7f41185d60ee06ffec93045c2c"><span class="identifier">allocation_command</span></a><span class="special">(</span><span class="identifier">allocation_type</span><span class="special">,</span> <span class="identifier">size_type</span><span class="special">,</span> <span class="identifier">size_type</span> <span class="special">&amp;</span><span class="special">,</span> 
                             <span class="identifier">pointer</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="identifier">size_type</span> <a class="link" href="classboost_1_1container_1_1node__allocator.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1node__allocator_1abe11f75c5f81e53c9465175f7901d808"><span class="identifier">size</span></a><span class="special">(</span><span class="identifier">pointer</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
  <span class="identifier">pointer</span> <a class="link" href="classboost_1_1container_1_1node__allocator.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1node__allocator_1ae16477b73fa9557a1157c2261aeb8f65"><span class="identifier">allocate_one</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="classboost_1_1container_1_1node__allocator.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1node__allocator_1aed423327cb7b310e1a114b9509c8024f"><span class="identifier">allocate_individual</span></a><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span><span class="special">,</span> <span class="identifier">multiallocation_chain</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="classboost_1_1container_1_1node__allocator.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1node__allocator_1a87512fbbe1d0250ab203e0a25ee77b6e"><span class="identifier">deallocate_one</span></a><span class="special">(</span><span class="identifier">pointer</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="classboost_1_1container_1_1node__allocator.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1node__allocator_1a3952b56a1db4937ab7e905a3f6491b35"><span class="identifier">deallocate_individual</span></a><span class="special">(</span><span class="identifier">multiallocation_chain</span> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="classboost_1_1container_1_1node__allocator.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1node__allocator_1a8f6bd58678d74c5e066975ee6c02a1f7"><span class="identifier">allocate_many</span></a><span class="special">(</span><span class="identifier">size_type</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span><span class="special">,</span> <span class="identifier">multiallocation_chain</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="classboost_1_1container_1_1node__allocator.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1node__allocator_1aff21837afd89f7b563d35b4aa663e6f8"><span class="identifier">allocate_many</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">size_type</span> <span class="special">*</span><span class="special">,</span> <span class="identifier">size_type</span><span class="special">,</span> <span class="identifier">multiallocation_chain</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="classboost_1_1container_1_1node__allocator.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1node__allocator_1ae09056e1e89045e4a98896e371efac8e"><span class="identifier">deallocate_many</span></a><span class="special">(</span><span class="identifier">multiallocation_chain</span> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="classboost_1_1container_1_1node__allocator.html#id68-bb">public static functions</a></span>
  <span class="keyword">static</span> <span class="keyword">void</span> <a class="link" href="classboost_1_1container_1_1node__allocator.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1node__allocator_1af2a54c4c7b0d27bdcefafbbec050f15e"><span class="identifier">deallocate_free_blocks</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="classboost_1_1container_1_1node__allocator.html#id69-bb">friend functions</a></span>
  <span class="keyword">void</span> <a class="link" href="classboost_1_1container_1_1node__allocator.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1node__allocator_1aac6a701921416e1e6b5e33685a95a7c1"><span class="identifier">swap</span></a><span class="special">(</span><span class="identifier">self_t</span> <span class="special">&amp;</span><span class="special">,</span> <span class="identifier">self_t</span> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
  <span class="keyword">bool</span> <a class="link" href="classboost_1_1container_1_1node__allocator.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1node__allocator_1ae48eea15dad6ab37a017e8f70e93cad4"><span class="keyword">operator</span><span class="special">==</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1container_1_1node__allocator.html" title="Class template node_allocator">node_allocator</a> <span class="special">&amp;</span><span class="special">,</span> <span class="keyword">const</span> <a class="link" href="classboost_1_1container_1_1node__allocator.html" title="Class template node_allocator">node_allocator</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
  <span class="keyword">bool</span> <a class="link" href="classboost_1_1container_1_1node__allocator.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1node__allocator_1aed51191b70cdace561ccb55fb09dd289"><span class="keyword">operator</span><span class="special">!=</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1container_1_1node__allocator.html" title="Class template node_allocator">node_allocator</a> <span class="special">&amp;</span><span class="special">,</span> <span class="keyword">const</span> <a class="link" href="classboost_1_1container_1_1node__allocator.html" title="Class template node_allocator">node_allocator</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="classboost_1_1container_1_1node__allocator.html#id70-bb">private member functions</a></span>
  <span class="identifier">pointer</span> <a class="link" href="classboost_1_1container_1_1node__allocator.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1node__allocator_1a946f0036b9bbdef5e94df87d2f6bcf73"><span class="identifier">priv_allocation_command</span></a><span class="special">(</span><span class="identifier">allocation_type</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span><span class="special">,</span> <span class="identifier">size_type</span> <span class="special">&amp;</span><span class="special">,</span> 
                                  <span class="identifier">pointer</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
<span class="special">}</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="id-1.3.8.14.19.3.4"></a><h2>Description</h2>
<p>An STL node allocator that uses a modified DlMalloc as memory source.</p>
<p>This node allocator shares a segregated storage between all instances of <a class="link" href="classboost_1_1container_1_1node__allocator.html" title="Class template node_allocator">node_allocator</a> with equal sizeof(T).</p>
<p>NodesPerBlock is the number of nodes allocated at once when the allocator runs out of nodes </p>
<div class="refsect2">
<a name="id-1.3.8.14.19.3.4.5"></a><h3>
<a name="id67-bb"></a><code class="computeroutput">node_allocator</code> public member functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1node__allocator_1a8a9ba47bdd739c3e42843b791aad7bf7"></a><span class="identifier">node_allocator</span><span class="special">(</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Default constructor. </li>
<li class="listitem">
<pre class="literallayout"><a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1node__allocator_1acea99bdd0b53a8f44deefa5b6991a8a2"></a><span class="identifier">node_allocator</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1container_1_1node__allocator.html" title="Class template node_allocator">node_allocator</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Copy constructor from other <a class="link" href="classboost_1_1container_1_1node__allocator.html" title="Class template node_allocator">node_allocator</a>. </li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T2<span class="special">&gt;</span> 
  <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1node__allocator_1a8fe90ccfc204384f56455cdf40d2cd1e"></a><span class="identifier">node_allocator</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1container_1_1node__allocator.html" title="Class template node_allocator">node_allocator</a><span class="special">&lt;</span> <span class="identifier">T2</span><span class="special">,</span> <span class="identifier">NodesPerBlock</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Copy constructor from related <a class="link" href="classboost_1_1container_1_1node__allocator.html" title="Class template node_allocator">node_allocator</a>. </li>
<li class="listitem">
<pre class="literallayout"><a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1node__allocator_1aae3f498dc2f6efe96c45ba9d4ef26f6a"></a><span class="special">~</span><span class="identifier">node_allocator</span><span class="special">(</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Destructor. </li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">size_type</span> <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1node__allocator_1ae9b979a89b441c9595841ce7bd9c7948"></a><span class="identifier">max_size</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p>Returns the number of elements that could be allocated. Never throws </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">pointer</span> <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1node__allocator_1a8bdfe2748b031138cedddf629b07366f"></a><span class="identifier">allocate</span><span class="special">(</span><span class="identifier">size_type</span> count<span class="special">,</span> <span class="keyword">const</span> <span class="keyword">void</span> <span class="special">*</span> <span class="special">=</span> <span class="number">0</span><span class="special">)</span><span class="special">;</span></pre>
<p>Allocate memory for an array of count elements. Throws bad_alloc if there is no enough memory </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1node__allocator_1a43fd4c135ae0ddfd386925f27d6ac82c"></a><span class="identifier">deallocate</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">pointer</span> <span class="special">&amp;</span> ptr<span class="special">,</span> <span class="identifier">size_type</span> count<span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>
<p>Deallocate allocated memory. Never throws </p>
</li>
<li class="listitem"><pre class="literallayout"><span class="identifier">pointer</span> <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1node__allocator_1a1d5cfc7f41185d60ee06ffec93045c2c"></a><span class="identifier">allocation_command</span><span class="special">(</span><span class="identifier">allocation_type</span> command<span class="special">,</span> <span class="identifier">size_type</span> limit_size<span class="special">,</span> 
                           <span class="identifier">size_type</span> <span class="special">&amp;</span> prefer_in_recvd_out_size<span class="special">,</span> 
                           <span class="identifier">pointer</span> <span class="special">&amp;</span> reuse<span class="special">)</span><span class="special">;</span></pre></li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">size_type</span> <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1node__allocator_1abe11f75c5f81e53c9465175f7901d808"></a><span class="identifier">size</span><span class="special">(</span><span class="identifier">pointer</span> p<span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>
<p>Returns maximum the number of objects the previously allocated memory pointed by p can hold. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">pointer</span> <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1node__allocator_1ae16477b73fa9557a1157c2261aeb8f65"></a><span class="identifier">allocate_one</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>
<p>Allocates just one object. Memory allocated with this function must be deallocated only with <a class="link" href="classboost_1_1container_1_1node__allocator.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1node__allocator_1a87512fbbe1d0250ab203e0a25ee77b6e">deallocate_one()</a>. Throws bad_alloc if there is no enough memory </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1node__allocator_1aed423327cb7b310e1a114b9509c8024f"></a><span class="identifier">allocate_individual</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> num_elements<span class="special">,</span> 
                         <span class="identifier">multiallocation_chain</span> <span class="special">&amp;</span> chain<span class="special">)</span><span class="special">;</span></pre>
<p>Allocates many elements of size == 1. Elements must be individually deallocated with <a class="link" href="classboost_1_1container_1_1node__allocator.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1node__allocator_1a87512fbbe1d0250ab203e0a25ee77b6e">deallocate_one()</a> </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1node__allocator_1a87512fbbe1d0250ab203e0a25ee77b6e"></a><span class="identifier">deallocate_one</span><span class="special">(</span><span class="identifier">pointer</span> p<span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>
<p>Deallocates memory previously allocated with <a class="link" href="classboost_1_1container_1_1node__allocator.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1node__allocator_1ae16477b73fa9557a1157c2261aeb8f65">allocate_one()</a>. You should never use deallocate_one to deallocate memory allocated with other functions different from <a class="link" href="classboost_1_1container_1_1node__allocator.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1node__allocator_1ae16477b73fa9557a1157c2261aeb8f65">allocate_one()</a>. Never throws </p>
</li>
<li class="listitem"><pre class="literallayout"><span class="keyword">void</span> <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1node__allocator_1a3952b56a1db4937ab7e905a3f6491b35"></a><span class="identifier">deallocate_individual</span><span class="special">(</span><span class="identifier">multiallocation_chain</span> <span class="special">&amp;</span> chain<span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre></li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1node__allocator_1a8f6bd58678d74c5e066975ee6c02a1f7"></a><span class="identifier">allocate_many</span><span class="special">(</span><span class="identifier">size_type</span> elem_size<span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> n_elements<span class="special">,</span> 
                   <span class="identifier">multiallocation_chain</span> <span class="special">&amp;</span> chain<span class="special">)</span><span class="special">;</span></pre>
<p>Allocates many elements of size elem_size. Elements must be individually deallocated with <a class="link" href="classboost_1_1container_1_1node__allocator.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1node__allocator_1a43fd4c135ae0ddfd386925f27d6ac82c">deallocate()</a> </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1node__allocator_1aff21837afd89f7b563d35b4aa663e6f8"></a><span class="identifier">allocate_many</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">size_type</span> <span class="special">*</span> elem_sizes<span class="special">,</span> <span class="identifier">size_type</span> n_elements<span class="special">,</span> 
                   <span class="identifier">multiallocation_chain</span> <span class="special">&amp;</span> chain<span class="special">)</span><span class="special">;</span></pre>
<p>Allocates n_elements elements, each one of size elem_sizes[i] Elements must be individually deallocated with <a class="link" href="classboost_1_1container_1_1node__allocator.html#doxygen.boost_container_header_reference.classboost_1_1container_1_1node__allocator_1a43fd4c135ae0ddfd386925f27d6ac82c">deallocate()</a> </p>
</li>
<li class="listitem"><pre class="literallayout"><span class="keyword">void</span> <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1node__allocator_1ae09056e1e89045e4a98896e371efac8e"></a><span class="identifier">deallocate_many</span><span class="special">(</span><span class="identifier">multiallocation_chain</span> <span class="special">&amp;</span> chain<span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre></li>
</ol></div>
</div>
<div class="refsect2">
<a name="id-1.3.8.14.19.3.4.6"></a><h3>
<a name="id68-bb"></a><code class="computeroutput">node_allocator</code> public static functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
<pre class="literallayout"><span class="keyword">static</span> <span class="keyword">void</span> <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1node__allocator_1af2a54c4c7b0d27bdcefafbbec050f15e"></a><span class="identifier">deallocate_free_blocks</span><span class="special">(</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Deallocates all free blocks of the pool. </li></ol></div>
</div>
<div class="refsect2">
<a name="id-1.3.8.14.19.3.4.7"></a><h3>
<a name="id69-bb"></a><code class="computeroutput">node_allocator</code> friend functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1node__allocator_1aac6a701921416e1e6b5e33685a95a7c1"></a><span class="identifier">swap</span><span class="special">(</span><span class="identifier">self_t</span> <span class="special">&amp;</span><span class="special">,</span> <span class="identifier">self_t</span> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>
<p>Swaps allocators. Does not throw. If each allocator is placed in a different memory segment, the result is undefined. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">bool</span> <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1node__allocator_1ae48eea15dad6ab37a017e8f70e93cad4"></a><span class="keyword">operator</span><span class="special">==</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1container_1_1node__allocator.html" title="Class template node_allocator">node_allocator</a> <span class="special">&amp;</span><span class="special">,</span> <span class="keyword">const</span> <a class="link" href="classboost_1_1container_1_1node__allocator.html" title="Class template node_allocator">node_allocator</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>
<p>An allocator always compares to true, as memory allocated with one instance can be deallocated by another instance </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">bool</span> <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1node__allocator_1aed51191b70cdace561ccb55fb09dd289"></a><span class="keyword">operator</span><span class="special">!=</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1container_1_1node__allocator.html" title="Class template node_allocator">node_allocator</a> <span class="special">&amp;</span><span class="special">,</span> <span class="keyword">const</span> <a class="link" href="classboost_1_1container_1_1node__allocator.html" title="Class template node_allocator">node_allocator</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>
<p>An allocator always compares to false, as memory allocated with one instance can be deallocated by another instance </p>
</li>
</ol></div>
</div>
<div class="refsect2">
<a name="id-1.3.8.14.19.3.4.8"></a><h3>
<a name="id70-bb"></a><code class="computeroutput">node_allocator</code> private member functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><pre class="literallayout"><span class="identifier">pointer</span> <a name="doxygen.boost_container_header_reference.classboost_1_1container_1_1node__allocator_1a946f0036b9bbdef5e94df87d2f6bcf73"></a><span class="identifier">priv_allocation_command</span><span class="special">(</span><span class="identifier">allocation_type</span> command<span class="special">,</span> 
                                <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> limit_size<span class="special">,</span> 
                                <span class="identifier">size_type</span> <span class="special">&amp;</span> prefer_in_recvd_out_size<span class="special">,</span> 
                                <span class="identifier">pointer</span> <span class="special">&amp;</span> reuse<span class="special">)</span><span class="special">;</span></pre></li></ol></div>
</div>
</div>
</div>
<div class="copyright-footer">Copyright © 2009-2018 Ion Gaztanaga<p>
        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
      </p>
</div>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="structboost_1_1container_1_1new__allocator_3_01void_01_4_1_1rebind.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_container_header_reference.html#doxygen.boost_container_header_reference.node__allocator_8hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="structboost_1_1container_1_1node__allocator_1_1rebind.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
